#!/bin/bash

path=`cd "$( dirname ${BASH_SOURCE[0]} )" && pwd`
config=$path/config
bin=$path/bin
python_config=$config/python
nodejs_config=$config/nodejs
python=$bin/python
nodejs=$bin/nodejs
yunzai=`cat $config/yunzai.txt`

cd $path
echo "开始部署资源"
echo "phi资源部署"
cp -rf $path/resources/Ill $path/$yunzai/plugins/phi-plugin/resources/
#cp -rf $path/resources/光遇绘画分享 $path/$yunzai/plugins/Tlon-Sky/resource/
cp -rf $path/resources/miao-character/profile $path/$yunzai/plugins/miao-plugin/resources/
cp -rf $path/resources/super-character/super-character $path/$yunzai/plugins/miao-plugin/resources/profile/
rm -rf $path/resources
cd $path

cd $path/$yunzai/plugins/TRSS-Plugin/RemBG
curl -LO https://mirror.ghproxy.com/https://github.com/TimeRainStarSky/TRSS-Plugin/releases/download/latest/u2net.onnx.xz
curl -LO https://mirror.ghproxy.com/https://github.com/TimeRainStarSky/TRSS-Plugin/releases/download/latest/isnetis.onnx.xz
xz -dv u2net.onnx.xz isnetis.onnx.xz

cd $path/$yunzai/plugins/TRSS-Plugin/ChatWaifu
curl -LO https://mirror.ghproxy.com/https://github.com/TimeRainStarSky/TRSS-Plugin/releases/download/latest/ChatWaifuCN.txz
tar -xvJf ChatWaifuCN.txz

cd $path/$yunzai/plugins/TRSS-Plugin/ChatWaifu
curl -LO https://mirror.ghproxy.com/https://github.com/TimeRainStarSky/TRSS-Plugin/releases/download/latest/ChatWaifuJP.txz
tar -xvJf ChatWaifuJP.txz


cd $path/$yunzai/plugins/TRSS-Plugin/GenshinVoice
curl -LO https://mirror.ghproxy.com/https://github.com/TimeRainStarSky/TRSS-Plugin/releases/download/latest/G_809000.pth.xz
xz -dv G_809000.pth.xz

#咕咕牛图库
curl -o "./plugins/example/MarryGuGuNiu.js" "https://raw.githubusercontent.com/lava081/SomeJsforMiaoYunzai/main/MarryGuGuNiu.js"

cd $path


